package com.atguigu.gmall.product.service.impl;

import com.atguigu.gmall.model.product.BaseTrademark;
import com.atguigu.gmall.product.mapper.BaseTrademarkMapper;
import com.atguigu.gmall.product.service.BaseTrademarkService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 品牌的分页显示，但是这些实现的接口的意义并没有深入研究，不太懂
 * @author WZhaokang
 * @date 2020/12/1 13:32
 */
@Service
public class BaseTrademarkServiceImpl extends ServiceImpl<BaseTrademarkMapper, BaseTrademark> implements BaseTrademarkService {

    @Autowired
    private BaseTrademarkMapper baseTrademarkMapper;

    /**
     * 品牌的分页显示
     * @param pageParam
     * @return
     */
    @Override
    public IPage<BaseTrademark> selectPage(Page<BaseTrademark> pageParam) {
        return baseTrademarkMapper.selectPage(pageParam,new QueryWrapper<BaseTrademark>().orderByDesc("id"));
    }
}
